package com.cd.song.jpa.repo;

import com.cd.song.jpa.domain.SongTagRelation;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * @Description create by JPA BUDDY
 * @Author lqq
 * @Date 2024/8/20 9:43
 **/
@Repository
public interface SongTagRelationRepo extends JpaRepository<SongTagRelation, Long> {

    Optional<SongTagRelation> findBySongIdAndTagId(Long songId, Long tagId);

    List<SongTagRelation> findByTagId(Long songId);

    int deleteBySongIdAndTagId(Long songId, Long tagId);
}
